<!DOCTYPE html>
<html>

	<head lang="en">
		<title>找攻略</title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		
		   <link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
			<script src="/js/jquery/jquery.min.js"></script>
			<script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
			<link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
			<link rel="stylesheet" href="/css/reset.css"/>
			<link rel="stylesheet" href="/css/strategyComment.css" />
			<script src="/js/plugins/jrender/jrender.min.js"></script>
			<link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
			<script src="/js/plugins/dialog2/dialog.min.js"></script>
		    <link rel="stylesheet" href="/js/plugins/dist/dialog.css" />
			<script src="/js/plugins/dist/mDialogMin.js"></script>
			<script src="/js/common.js"></script>
		<script>
			$(function () {
				//获取当前查看用户
				var params = getParams();
				var currentPage = 1;    // 默认第一页
				var pages;  // 总页数
				var loading = false;    // 标记是否查询中
				var fansArr = []; // 关注存储的容器

				function query() {  // 分页查询
					if (loading) {    // 代表正在查询,就直接结束方法
						return;
					}
					loading = true; // 标记正在查询中;
					// 根据主评论id查询评论信息
					$.get(baseUrl + "/users/" + params.id + "/fans", {currentPage: currentPage}, function (data) {
						$.merge(fansArr, data.list);  // 合并数据,把第二个参数的数据合并到第一个参数的容器中
						var json = {list: fansArr};    // 用于render-loop="list"
						$(".fans").renderValues(json, {
							getHref: getHref
						});
						currentPage++;  // 当前页数+1
						pages = data.pages; // 设置总页数
						loading = false;    // 标记查询结束
					});
				}

				// 默认查询第一页
				query();
				// 监听窗口的滚动事件
				$(window).scroll(function () {
					console.log("窗口滚动中...")
					if ($(document).scrollTop() + $(window).height() >= $(document).height()) { // 滚动到底部
						// 如果已经查询到最后一页,就不再查
						if (currentPage <= pages) {
							query();
						} else {
							$(document).dialog({
								type: 'notice',
								content: '<span class="info-text">已经到底了!</span>',
								autoClose: 1500
							});
						}
					}
				});

			})

		</script>
	</head>

	<body>
		<div class="search-head">
			<div class="row nav-search">
				<div class="col">
					<a  href="javascript:window.history.go(-1)" class="my-arrow">
						<span><i class="fa fa-chevron-left"></i></span>
					</a>
				</div>
				<div class="col">
					<span>他的粉丝</span>
				</div>
				<div class="col"></div>
			</div>
		</div>



		<!--主评论-->
		<div class="fans">
			<div render-loop="list">
			<div class="container ">
				<div class="row">
					<div class="col-2 fans-head">
						<a render-key="list.id" render-fun="getHref" data-url="/userProfiles.html?id=">
							<img class="rounded-circle" render-src="list.headImgUrl" width="50">

							<span style="font-size: 15px;color:black">性别</span>
							<span style="font-size: 15px;color:black" render-html="list.genderName"></span>

						</a>
					</div>
					<div class="col">
						<span render-html="list.nickName" style="font-size: 10px;color: black"></span>
						<a render-key="list.id" render-fun="getHref" data-url="/focusList.html?id=" style="font-size: 15px;color:deepskyblue">关注</a>
						<span render-html="list.followCount"></span>
						<a render-key="list.id" render-fun="getHref" data-url="/fansList.html?id=" style="font-size: 15px;color:deeppink">粉丝</a>
						<span render-html="list.fansCount"></span>
						<span style="font-size: 15px;color:green">地区</span> <span render-html="list.place"></span>
						<div class="fans-content" >
							<span style="font-size: 10px;color:blueviolet">个性签名:</span><p render-html="list.sign">手来散散步都是好的。</p>
						</div>
						<HR>
					</div>
				</div>
			</div>
			</div>
		</div>



		<div class="operation">
			<div class="d-flex justify-content-between">
				<div class="p-2"><i class="fa fa-fansing-o"></i>
					<span class="mDialogs replyBtn"  href="javascript:;"  data-type="1">添加你的评论吧</span></div>
				<div class="p-2"><i class="fa fa-star-o"></i> 收藏</div>
			</div>
		</div>

</body>

</html>